Skip to content

Display only publications in in_pre_publication_state in EditionFilter of StatisticsAnnouncementPublicationController [WHIT-3132]#11474

Merged
patrickpatrickpatrick merged 1 commit into
mainfrom
display-only-draft-publications-for-announcments
May 22, 2026
Merged

Display only publications in in_pre_publication_state in EditionFilter of StatisticsAnnouncementPublicationController [WHIT-3132]#11474
patrickpatrickpatrick merged 1 commit into
mainfrom
display-only-draft-publications-for-announcments

Conversation

@patrickpatrickpatrick
Copy link
Copy Markdown
Contributor

@patrickpatrickpatrick patrickpatrickpatrick commented May 19, 2026

What

  • Update filter of StatisticsAnnouncementPublicationController

Why

Only present to the user unpublished editions in the results page for filtering documents to connect to a StatisticsAnnouncement. This prevents a user connecting a published edition which had unintended consequences.

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

This application is owned by the Whitehall Experience team. Please let us know in #govuk-whitehall-experience-tech when you raise any PRs.

Follow these steps if you are doing a Rails upgrade.

@patrickpatrickpatrick patrickpatrickpatrick changed the title display only draft publications for announcments Display only publications without_not_published in filter of StatisticsAnnouncement [WHIT-3132] May 19, 2026
@patrickpatrickpatrick patrickpatrickpatrick force-pushed the display-only-draft-publications-for-announcments branch 2 times, most recently from abe274d to 4207deb Compare May 21, 2026 09:38
@patrickpatrickpatrick patrickpatrickpatrick changed the title Display only publications without_not_published in filter of StatisticsAnnouncement [WHIT-3132] Display only publications without_draft in filter of StatisticsAnnouncement [WHIT-3132] May 21, 2026
@patrickpatrickpatrick patrickpatrickpatrick changed the title Display only publications without_draft in filter of StatisticsAnnouncement [WHIT-3132] Display only publications without_draft in filter of StatisticsAnnouncement [WHIT-3132] May 21, 2026
@patrickpatrickpatrick patrickpatrickpatrick force-pushed the display-only-draft-publications-for-announcments branch 2 times, most recently from b8bc74c to d480f95 Compare May 21, 2026 10:05
@patrickpatrickpatrick patrickpatrickpatrick changed the title Display only publications without_draft in filter of StatisticsAnnouncement [WHIT-3132] Display only publications without_draft in EditionFilter of StatisticsAnnouncementPublicationController` [WHIT-3132] May 21, 2026
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you not append .in_pre_publication_state here rather than add a new edition filter option?

scope :in_pre_publication_state, -> { where(state: Edition::PRE_PUBLICATION_STATES) }

Copy link
Copy Markdown
Contributor

@davidsauntson davidsauntson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could be confused, but I think might be the other way around from what is in the ticket.

https://gov-uk.atlassian.net/browse/WHIT-3132 says that you should only be able to link the statistics announcements to a draft, since when that draft is published, the statistics announcement redirects to the published thing and not the other way around.

@patrickpatrickpatrick patrickpatrickpatrick force-pushed the display-only-draft-publications-for-announcments branch from d480f95 to 2cfd443 Compare May 21, 2026 13:09
@patrickpatrickpatrick patrickpatrickpatrick changed the title Display only publications without_draft in EditionFilter of StatisticsAnnouncementPublicationController` [WHIT-3132] Display only publications in in_pre_publication_state in EditionFilter of StatisticsAnnouncementPublicationController [WHIT-3132] May 21, 2026
@patrickpatrickpatrick patrickpatrickpatrick force-pushed the display-only-draft-publications-for-announcments branch 2 times, most recently from 4ec5b38 to c397b37 Compare May 21, 2026 13:28
Only present to the user documents with an unpublished
edition in the results page for filtering documents to
connect to a StatisticsAnnouncement. This prevents a user connecting a
published edition which had unintended consequences.
@patrickpatrickpatrick patrickpatrickpatrick force-pushed the display-only-draft-publications-for-announcments branch from c397b37 to 4520a0e Compare May 21, 2026 13:39
Copy link
Copy Markdown
Contributor

@ChrisBAshton ChrisBAshton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@patrickpatrickpatrick patrickpatrickpatrick merged commit 3a3ee89 into main May 22, 2026
25 checks passed
@patrickpatrickpatrick patrickpatrickpatrick deleted the display-only-draft-publications-for-announcments branch May 22, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants